package com.waterdrop.wlsggk.service.impl;


import com.waterdrop.wlsggk.mapper.MaterialReplenishmentLogMapper;
import com.waterdrop.wlsggk.pojo.MaterialReplenishmentLog;
import com.waterdrop.wlsggk.service.MaterialReplenishmentLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 分仓库补货量日志库信息 服务层处理
 *
 * @author ruoyi
 */
@Service
public class MaterialReplenishmentLogServicelmpl implements MaterialReplenishmentLogService {

    @Autowired
    private MaterialReplenishmentLogMapper materialReplenishmentLogMapper;

    /**
     * 添加分仓库补货量日志
     *
     * @param materialReplenishmentLog 分仓库补货量日志信息
     * @return 结果
     */
    @Override
    @Transactional
    public int insertWlsggkMaterialReplenishmentLog(List<MaterialReplenishmentLog> materialReplenishmentLog) {
        for (MaterialReplenishmentLog wlsggkMaterialRemainingLog1 : materialReplenishmentLog) {
            materialReplenishmentLogMapper.insertWlsggkMaterialReplenishmentLog(wlsggkMaterialRemainingLog1);
        }
        return 1;
    }

    /**
     * 查询分仓库补货量日志数据集合
     *
     * @param materialReplenishmentLog 分仓库补货量日志信息
     * @return 分仓库补货量日志数据集合
     */
    @Override
    public List<MaterialReplenishmentLog> selectMaterialReplenishmentLogList(MaterialReplenishmentLog materialReplenishmentLog, @Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime) {
        return materialReplenishmentLogMapper.selectMaterialReplenishmentLogList(materialReplenishmentLog, startTime, endTime);
    }

    /**
     * 删除分仓库补货量日志信息
     *
     * @param ids 分仓库补货量日志ID
     * @return 结果
     */
    @Override
    public int deleteWlsggkMaterialReplenishmentLog(Long[] ids) {
        return materialReplenishmentLogMapper.deleteWlsggkMaterialReplenishmentLogByIds(ids);
    }


}




